﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.EntityFrameworkCore;

namespace Bridge.Shared.Extensions
{
    public class BridgeDbContext<T> : AbpDbContext<T> where T : DbContext
    {
        public MyLogDbCommandInterceptor logInterceptor => LazyServiceProvider.LazyGetRequiredService<MyLogDbCommandInterceptor>();
        public BridgeDbContext(DbContextOptions<T> options) : base(options)
        {
        }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.AddInterceptors(logInterceptor);
            optionsBuilder.EnableSensitiveDataLogging();
            base.OnConfiguring(optionsBuilder);

        }
    }
}
